/*
 *
 * @ProjectName:    my_umi_app
 * @Package:
 * @ClassName:      modal_widget
 * @Description:    弹出窗
 * @Author:         SuPeiSen
 * @CreateDate:     2021/3/10 10:16 上午
 * @UpdateDate:     2021/3/10 10:16 上午
 * @UpdateRemark:   更新说明：
 * @Version:        1.0
 */

import { Modal, Button } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import React from 'react';

const { confirm } = Modal;

/**
 * 删除弹窗窗
 * @constructor
 */
export const DeleteModalWidget = (props: {
  onOk: () => void;
  onCancel: () => void;
  children: JSX.Element;
}) => {
  function showConfirm() {
    confirm({
      title: '删除确认?',
      icon: <ExclamationCircleOutlined />,
      okText: '确认',
      cancelText: '取消',
      content: '操作无法撤销',
      onOk: props.onOk,
      onCancel: props.onCancel,
    });
  }
  return <div onClick={showConfirm}>{props.children}</div>;
};
